<html>
<head><meta charset="utf-8"><title>Will there be a rust_2021_idioms lint? · edition 2021 · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/index.html">edition 2021</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/Will.20there.20be.20a.20rust_2021_idioms.20lint.3F.html">Will there be a rust_2021_idioms lint?</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="247216144"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/Will%20there%20be%20a%20rust_2021_idioms%20lint%3F/near/247216144" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/Will.20there.20be.20a.20rust_2021_idioms.20lint.3F.html#247216144">(Jul 26 2021 at 15:12)</a>:</h4>
<p>I'm so used to adding <code>#[deny(rust_2018_idioms)]</code> to my 2018 crates — will there be an equivalent for 2021?</p>



<a name="247216584"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/Will%20there%20be%20a%20rust_2021_idioms%20lint%3F/near/247216584" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Eric Huss <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/Will.20there.20be.20a.20rust_2021_idioms.20lint.3F.html#247216584">(Jul 26 2021 at 15:15)</a>:</h4>
<p>There is no plan to add it.</p>



<a name="247216771"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/Will%20there%20be%20a%20rust_2021_idioms%20lint%3F/near/247216771" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/Will.20there.20be.20a.20rust_2021_idioms.20lint.3F.html#247216771">(Jul 26 2021 at 15:16)</a>:</h4>
<p>Not needed or not needed <em>yet</em>?</p>



<a name="247217909"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/Will%20there%20be%20a%20rust_2021_idioms%20lint%3F/near/247217909" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Eric Huss <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/Will.20there.20be.20a.20rust_2021_idioms.20lint.3F.html#247217909">(Jul 26 2021 at 15:24)</a>:</h4>
<p>It is not needed.  None of the changes needs fixing up after transitioning.</p>



<a name="247218184"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/Will%20there%20be%20a%20rust_2021_idioms%20lint%3F/near/247218184" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/Will.20there.20be.20a.20rust_2021_idioms.20lint.3F.html#247218184">(Jul 26 2021 at 15:26)</a>:</h4>
<blockquote>
<p>fixing up after transitioning</p>
</blockquote>
<p>Hmm... my primary usage of <code>rust_2018_idioms</code> was for elided lifetimes in paths. I never thought of that as something that needed "fixing up", but as a "we decided this was bad and our transition plan to something better was this lint". There are no equivalent changes this time around?</p>



<a name="247218308"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/Will%20there%20be%20a%20rust_2021_idioms%20lint%3F/near/247218308" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/Will.20there.20be.20a.20rust_2021_idioms.20lint.3F.html#247218308">(Jul 26 2021 at 15:27)</a>:</h4>
<p>Looking back now, I treat it as a "opt in to things that will probably be errors in the next edition".</p>



<a name="247220554"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/Will%20there%20be%20a%20rust_2021_idioms%20lint%3F/near/247220554" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Eric Huss <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/Will.20there.20be.20a.20rust_2021_idioms.20lint.3F.html#247220554">(Jul 26 2021 at 15:42)</a>:</h4>
<p>Yea, the 2018 idioms were used for multiple purposes.  Some were "clean up after setting edition=2018" and some were "this is the style people should use", but there was a lack of commitment on that second category.</p>
<p>Of the current 2018 idiom set:</p>
<ul>
<li><code>bare-trait-objects</code> and <code>ellipsis-inclusive-range-patterns</code> are warn-by-default on all editions, and an error in 2021.</li>
<li><code>unused-extern-crates</code> is allow-by-default because it is still buggy.</li>
<li><code>elided-lifetimes-in-paths</code> and <code>explicit-outlives-requirements</code> are allow-by-default because they are still buggy, and nobody has committed to forcing those styles.</li>
</ul>



<a name="247229678"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/Will%20there%20be%20a%20rust_2021_idioms%20lint%3F/near/247229678" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jake Goulding <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/Will.20there.20be.20a.20rust_2021_idioms.20lint.3F.html#247229678">(Jul 26 2021 at 16:51)</a>:</h4>
<blockquote>
<p><code>elided-lifetimes-in-paths</code> [is] allow-by-default</p>
</blockquote>
<p>That is unfortunate. So very often I will tell someone to enable <code>rust_2018_idioms</code> purely for <code>elided-lifetimes-in-paths</code> because they have typed the wrong thing (by not typing anything at all) and their lifetimes are misconstrained.</p>
<p>I guess my advice will have to change to tell people to just enable that by itself.</p>
<blockquote>
<p><code>elided-lifetimes-in-paths</code> [is] still buggy</p>
</blockquote>
<p>I'm surprised by that — I haven't noticed any bugs. The worst "bug" is that the hint it gives isn't always correct, but trying to figure out what someone means from failing code is a tough task. <span aria-label="wink" class="emoji emoji-1f609" role="img" title="wink">:wink:</span></p>



<a name="247232811"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/268952-edition%202021/topic/Will%20there%20be%20a%20rust_2021_idioms%20lint%3F/near/247232811" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Eric Huss <a href="https://rust-lang.github.io/zulip_archive/stream/268952-edition-2021/topic/Will.20there.20be.20a.20rust_2021_idioms.20lint.3F.html#247232811">(Jul 26 2021 at 17:16)</a>:</h4>
<p>Yea, by bugs I mean it can give incorrect suggestions.  <a href="https://github.com/rust-lang/rust/issues/54910">#54910</a> has the links to them which I think you wrote.</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>